const setLocalStorage = (key, value) => {
    console.log(value instanceof Array)
    console.log(value instanceof Object)
    if (value instanceof Array || value instanceof Object) {
        value = JSON.stringify(value)
    }
    localStorage.setItem(key, value);
}
const getLocalStorage = (key) => {
    var val = localStorage.getItem(key);
    var reg = /^[\[{].*[\]}]$/
    if (reg.test(val)) {
        value = JSON.parse(val);
    }
}